#!/bin/bash

set -e

# 定义变量
NAMESPACE="middleware"
RELEASE_NAME="kafka"

# 删除Kafka实例
helm delete "$RELEASE_NAME" --namespace "$NAMESPACE"

# 等待Kafka实例完全删除
echo "等待Kafka实例删除..."
while kubectl get statefulsets -n "$NAMESPACE" | grep "$RELEASE_NAME"; do
  echo "等待Kafka实例删除..."
  sleep 5
done

echo "卸载完成"
